import Vue from 'vue'
import VueRouter from 'vue-router'
import Song from '../views/Song.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',  //歌单
    name: 'Song',
    component: Song
  },
  {
    path: '/newSong', //新歌
    name: 'NewSong',
    component: () => import('@/views/NewSong.vue')
  },
  {
    path: '/ranking', //排行
    name: 'Ranking',
    component: () => import('@/views/Ranking.vue')
  },
  // {
  //   path: '/singer', //歌手
  //   name: 'Singer',
  //   component: () => import('@/views/Singer.vue')
  // },
  {
    path: '/search', //搜索
    name: 'Search',
    component: () => import('@/views/Search.vue')
  },
  {
    path: '/playList/:listid',  //播放列表
    name: 'PlayList',
    props:true,  //把listid注入组件props
    component: () => import('@/views/PlayList.vue')
  },
  {
    path:'/singerdetails/:singerid', //最佳歌手匹配详情
    name:"Singerdetails",
    props:true,
    meta:{ //跳转后隐藏菜单栏
      sindetail:true
    },
    component:() => import('@/views/Singerdetails.vue')
  }
  
]

const router = new VueRouter({
  mode:'hash',
  routes,
  base: process.env.BASE_URL,
})

export default router
